package Thread;

/**
 * @className: CreateThread
 * @author: 芃
 * @description: 通过实现Thread类，重写Run方法
 * @date: 2024/1/14 12:37
 */
class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("hello world " + i);
        }
    }
}
public class CreateThread1 {
    public static void main(String[] args) {
        Thread myThread = new MyThread();
        //myThread.run();//只描述线程的任务，实际上并没有创建线程
        myThread.start();
    }
}
